package com.web.common.document.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Range;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

/**
 * <p>
 * 文档的章节
 * </p>
 *
 * @author zhouhui
 * @since 2023-12-08
 */
@Getter
@Setter
@TableName("document_chapter")
@Schema(title = "DocumentChapter对象", description = "文档的章节")
public class DocumentChapter implements Serializable {

    private static final long serialVersionUID = 1L;

    /** 章节的主键 */
    @Schema(title = "章节的主键")
    @TableId(value = "main_id", type = IdType.AUTO)
    private Integer mainId;
    
    /** document_info表的主键 */
    @NotNull(message = "未选择文档信息")
    @Schema(title = "document_info表的主键")
    private Integer infoId;

    /** 章节层级的父节点id，根节点为0 */
    @NotNull(message = "未选择父级目录")
    @Schema(title = "章节层级的父节点id，根节点为0")
    private Integer parentId;

    /** 章节的标题 */
    @NotBlank(message = "未填写章节的标题")
    @Schema(title = "章节的标题")
    private String title;
    
    /** 类型，0目录；1章节 */
    @NotNull(message = "未选择章节类型")
    @Range(min = 0, max = 1, message = "未设置正确的章节类型")
    @Schema(title = "类型，0目录；1章节")
    private Integer type;

    /** 内容的索引值 */
    @Schema(title = "内容的索引值")
    private String contentIndex;
    
    /** 文档的创建者 */
    @Schema(title = "文档的创建者")
    private Integer ownerId;
    
    /** 排序，值越小越靠前 */
    @Schema(title = "排序，值越小越靠前")
    private Integer sort;

    /** 删除状态，0、有效；1、已删除 */
    @Schema(title = "删除状态，0、有效；1、已删除")
    private Integer delFlag;

    /** 创建时间 */
    @Schema(title = "创建时间")
    private LocalDateTime createTime;

    /** 更新时间 */
    @Schema(title = "更新时间")
    private LocalDateTime updateTime;
}
